<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
</head>

<body>
<div id="header-vue" class="layui-layout layui-layout-admin" style="width:100%">
    <div class="layui-header">
        <div class="layui-logo">影易购后台</div>
        <div class="nav">
            <ul class="layui-nav layui-layout-left">
                <li class="layui-nav-item"><a href="/html/mainPage.html">首页</a></li>
                <li class="layui-nav-item"><a href="/html/movieList.html">电影</a></li>
                <li class="layui-nav-item">
                    <input @keyup.enter="searchOfKeyWord($event.target)" type="text" placeholder="搜索电影"
                           id="searchMovie" class="layui-input" style="height: 30px;
                            padding-left: 12px;
                            background-color: #424652;
                            background-color: rgba(255,255,255,.05);
                            border: none 0;
                            color: #fff;
                            color: rgba(255,255,255,.5);
                            font-size: 12px;">
                </li>
            </ul>
        </div>

        <ul class="layui-nav layui-layout-right">
            <li class="layui-nav-item" v-if="loginUser != ''">
                <a href="center.html">
                    <img :src="loginUser.userHeadImg" class="layui-nav-img" v-if="loginUser.userHeadImg!=null">
                    <!-- <img src="http://192.168.74.129:80/images/user/profile_small_p4.png" class="layui-nav-img"
                        v-if="loginUser.userHeadImg==null"> -->
                    欢迎您！{{loginUser.userName}}
                </a>
                <!-- <dl class="layui-nav-child"></dl> -->
            </li>
            <li class="layui-nav-item" v-if="loginUser == ''">
                <a href="login.html">
                    <img src="http://192.168.74.129:80/images/user/profile_small_p4.png" class="layui-nav-img">
                    去登录
                </a>
            </li>
            <li class="layui-nav-item" v-if="loginUser != ''">
                <a @click="signOut">
                    退出登录
                </a>
            </li>
        </ul>
    </div>
</div>
</body>

<script>
    var header = new Vue({
        el: "#header-vue",
        data: {
            userId: '',			// 当前登录用户的ID
            loginUser: '',		// 当前登录用户的信息
        },
        methods: {
            findUser: header_yh_controller.findUser,
            signOut: header_yh_controller.signOut,
            searchOfKeyWord: header_yh_service.searchOfKeyWord,
        },
        created: header_yh_service.created
    })
</script>

</html>